{extend name="shop/showstore/common/store_layout" /}
{block name="content"}

<script type="text/javascript" src="__SITE_RESOURCE__/js/jquery.charCount.js"></script>
<script type="text/javascript" src="__SITE_RESOURCE__/js/member.js" charset="utf-8"></script>
<script type="text/javascript" src="__SITE_RESOURCE__/js/sns.js" charset="utf-8"></script>
<script type="text/javascript" src="__SHOP_RESOURCE__/js/sns_store.js" charset="utf-8"></script>
<script type="text/javascript" src="__SITE_RESOURCE__/js/smilies/smilies_data.js" charset="utf-8"></script>
<script type="text/javascript" src="__SITE_RESOURCE__/js/smilies/smilies.js" charset="utf-8"></script>
<script type="text/javascript" src="__SITE_RESOURCE__/js/jquery.caretInsert.js" charset="utf-8"></script>
<script>
var MAX_RECORDNUM = <?php echo $max_recordnum;?>;
</script>

<div class="cms-sns">
  <div class="cms-sns-left">
    <div class="cms-sns-tabmene">
      <ul>
        <li><a href="<?php echo url('shop/Showsnshome/index', array('sid' => $store_info['store_id']));?>" <?php if(I('param.type') == ''){?>class="selected"<?php }?>>全部动态<i></i></a></li>
        <li><a href="<?php echo url('shop/Showsnshome/index', array('sid' => $store_info['store_id'], 'type' => 'promotion'));?>" <?php if(I('param.type') == 'promotion'){?>class="selected"<?php }?>>促销<i></i></a></li>
        <li><a href="<?php echo url('shop/Showsnshome/index', array('sid' => $store_info['store_id'], 'type' => 'new'));?>" <?php if(I('param.type') == 'new'){?>class="selected"<?php }?>>新品<i></i></a></li>
        <li><a href="<?php echo url('shop/Showsnshome/index', array('sid' => $store_info['store_id'], 'type' => 'hotsell'));?>" <?php if(I('param.type') == 'hotsell'){?>class="selected"<?php }?>>热卖<i></i></a></li>
        <li><a href="<?php echo url('shop/Showsnshome/index', array('sid' => $store_info['store_id'], 'type' => 'recommend'));?>" <?php if(I('param.type') == 'recommend'){?>class="selected"<?php }?>>店主推荐<i></i></a></li>
      </ul>
    </div>
    <div class="cms-sns-content">
      <?php if(!empty($strace_array)){?>
      <ul class="cms-sns-content-list">
        <?php foreach($strace_array as $val){?>
        <li nc_type="tracerow_<?php echo $val['strace_id']; ?>">
          <dl>
            <dt>
              <h5><?php echo parsesmiles($val['strace_title']);?></h5>
              <?php if (session('store_id') == $val['strace_storeid']){?>
              <span class="fd-handle"> <a href="javascript:void(0);" nc_type="sd_del" data-param='{"txtid":"<?php echo $val['strace_id'];?>"}'><i class="icon-trash"></i>删除</a> </span>
              <?php }?>
            </dt>
            <dd> <?php echo parsesmiles($val['strace_content']);?> </dd>
            <dd>
            	<span class="goods-time fl"><?php echo date('Y-m-d H:i',$val['strace_time']);?></span>
            	<!--<span class="fr">
            		<a href="javascript:void(0);" nc_type="sd_forwardbtn" data-param='{"txtid":"<?php echo $val['strace_id'];?>"}'>转发</a>&nbsp;|&nbsp;<a href="javascript:void(0);" nc_type="sd_commentbtn" data-param='{"txtid":"<?php echo $val['strace_id'];?>"}'>评论<?php echo $val['strace_comment']>0?"(".$val['strace_comment'].")":'';?></a>
            	</span> -->
            </dd>
            <dd>
              <!-- 评论模块start -->
              <div id="tracereply_<?php echo $val['strace_id'];?>" style="display:none;"></div>
              <!-- 评论模块end -->
              <!-- 转发模块start -->
              <div id="forward_<?php echo $val['strace_id'];?>" style="display:none;">
                <div class="forward-widget">
                  <div class="forward-edit">
                    <form id="forwardform_<?php echo $val['strace_id'];?>" method="post" action="{:url('shop/Showsnshome/addforward')}">
                      <input type="hidden" name="stid" value="<?php echo $val['strace_id'];?>"/>
                      <div class="forward-add">
                        <textarea resize="none" id="content_forward<?php echo $val['strace_id'];?>" name="forwardcontent"><?php echo $v['trace_title_forward'];?></textarea>
                        <span class="error"></span>
                        <!-- 验证码 -->
                        <div id="forwardseccode<?php echo $val['strace_id'];?>" class="seccode" style="display: none;">
                          <label for="captcha">验证码：</label>
                          <input name="captcha" class="text" type="text" size="4" maxlength="4"/>
                          <img src="" title="点击更换验证码" name="codeimage" onclick="this.src='{:url(\'verify_code\')}?t=' + Math.random();"/> <span>您的操作过度频繁，请输入验证码后继续。</span>
                          <input type="hidden" name="nchash" value="<?php echo $nchash;?>"/>
                        </div>
                        <input type="text" style="display:none;" />
                        <!-- 防止点击Enter键提交 -->
                        <div class="act">
                        	<span class="skin-blue"><span class="btn">
                        	<a href="javascript:void(0);" nc_type="s_forwardbtn" data-param='{"txtid":"<?php echo $val['strace_id'];?>"}'>转发</a></span></span>
                        	<span id="forwardcharcount<?php echo $val['strace_id'];?>" style="float:right;"></span> <a class="face" nc_type="smiliesbtn" data-param='{"txtid":"forward<?php echo $val['strace_id'];?>"}' href="javascript:void(0);" >表情</a>
                        </div>
                      </div>
                    </form>
                  </div>
                  <ul class="forward-list">
                  </ul>
                </div>
              </div>
              <!-- 转发模块end -->
              <div class="clear"></div>
            </dd>
          </dl>
        </li>
        <?php }?>
      </ul>
      <div id="pagehtml" class="tc mt10 mb10">
        <div class="pagination"><?php echo $show_page ;?></div>
      </div>
      <?php }else{?>
      <div class="null">该店铺还没有发过相关店铺动态。</div>
      <?php }?>
    </div>
    <!-- 表情弹出层 -->
    <div id="smilies_div" class="smilies-module"></div>
  </div>
  <div class="cms-sns-right">
    <div class="cms-sns-right-container">
      <div class="cms-store-pic"><a>
      	<img src="{$store_info['store_avatar']|getStoreLogo}" alt="<?php echo $store_info['store_name'];?>" title="<?php echo $store_info['store_name'];?>" /></a></div>
      <dl class="cms-store-info">
        <dt><?php echo $store_info['store_name']; ?></dt>
        <dd>已收藏：<em nctype="store_collect"><?php echo $store_info['store_collect']?></em></dd>
      </dl>
      <div class="cms-store-favorites">
      	<a href="javascript:collect_store('<?php echo $store_info['store_id'];?>','count','store_collect')" ><i class="icon-plus"></i>收藏店铺</a></div>
    </div>
    <!--<div class="cms-sns-right-container">
      <?php if (!empty($favorites_list)) {?>
      <div class="title">最新收藏用户</div>
      <div class="cms-favorites-user">
        <ul>
          <?php foreach ($favorites_list as $val) {?>
          <li><a target="_blank" href="<?php echo url('member/Snshome/index', array('mid'=>$val['member_id']));?>">
          	<img alt="<?php echo $val['member_name'];?>" title="<?php echo $val['member_name'];?>" src="{$val['member_avatar']|default='/static/upload/shop/common/default_user_portrait.gif'}" /></a></li>
          <?php }?>
        </ul>
      </div>
    </div>-->
    <?php }?>
  </div>
</div>
{/block}
